include(../public.cmake)

project(JXQNetwork)

project_version_conf()

#-----------------------------------------------------------------------------------

include_directories(
	. socket server
	../JXQCore
	../JXQCore/meta
	../JXQCore/container
	../JXQCore/concurrent
	../JXQIO
	../JXQIO/bus
	../JXQIO/fs
	../JXQIO/process
	../../include)

set(HEADER_LIST
	jhostaddr.h
	jnetinfo.h
	socket/jabstractsocket.h
	socket/jtcpsocket.h
	socket/judpsocket.h
	server/jtcpserver.h
	server/judpserver.h
	)

list(APPEND SRC_LIST
	jhostaddr.cpp
	jnetinfo.cpp
	socket/jabstractsocket.cpp
	socket/jtcpsocket.cpp
	socket/judpsocket.cpp
	server/jtcpserver.cpp
	server/judpserver.cpp
	)

#-----------------------------------------------------------------------------------

if(WIN32)
	list(APPEND SRC_LIST socket/jabstractsocket_win.cpp)
elseif(UNIX)
	list(APPEND SRC_LIST socket/jabstractsocket_unix.cpp)
endif()

#-----------------------------------------------------------------------------------

FILE(GLOB_RECURSE G_HEADER_LIST ../../include/JXQNetwork/*)

add_library(${PROJECT_NAME} SHARED
	${SRC_LIST}
	${HEADER_LIST}
	${G_HEADER_LIST}
	${VERSIONINFO_RC}
)

target_link_libraries(${PROJECT_NAME} PRIVATE JXQCore)
target_link_libraries(${PROJECT_NAME} PRIVATE JXQIO)

#-----------------------------------------------------------------------------------

output_conf()

file(COPY ${HEADER_LIST} DESTINATION
	${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/include/JXQNetwork)

